<select> element

The <select> element specifies a list of options from which the user can choose. You can specify either single- or multiple-choice <select> elements.

Syntax

where text represents the text and/or image the device will display to prompt the user for selection and content represents the list of items from which to choose. You can define selection content using one or more of the following elements:
 
content You can specify either of the following elements in a <select> list: 
<optgroup> 
<option> 
(not currently supported by the UP.Browser)
(see <option> element

Devices display these elements in the order in which you specify them.

Attributes

 
title Specifies a brief label for the <select> list. Some devices use the label as a title when displaying the <select> content. Others might use it as a label for a user interface mechanism that lets the user navigate to the <select> content. For example, if a device cannot display all card content on one screen and ordered="true," the UP.Browser uses the title to identify this select list on a summary-level menu. 
multiple true | false

Specifies whether the user can select multiple items. 

name The name of the variable in which the device stores the value(s) associated with the option(s) chosen by the user. The value associated with each option comes from the <option> element value attribute. 

The value(s) in the specified variable determine the default selection(s) when the device displays the <select> element. If the variable has no value, the device sets it to the value(s) specified for the default attribute. If you do not specify a default value, the device initializes the variable to an empty string (""). 

In the case of multiple selections, the values are stored as a semicolon-separated list (see example). 

value A string specifying the default value(s) for the variable specified by the name attribute. 

If the name attribute already has a value when the user navigates to the <select> element, the device ignores the value attribute. If the name attribute does not already have a value, the device sets it to the value specified by the value attribute. 

iname Identical to the name attribute except for the following: 
  • The specified variable stores the index value(s) associated with the option(s) chosen by the user. The index value associated with each option comes from its position in the <select> list, starting with 1. If the user has not selected an option, the index value is 0
  • The default value is specified by the ivalue attribute. 
ivalue Identical to the default attribute except for the following: 
  • The specified string contains the default index value(s) for the variable specified by the iname attribute. 

Example

In the following example, "Dog" and "Cat" are the default selections if the variable i has no value when the device displays the card. Choosing "Cat" and "Horse" sets the variable x to the value "C;H" and the variable i to the value "2;3".